package com.linsir.lin.service;

import com.linsir.core.BaseResponse;
import com.linsir.lin.dto.GridDTO;
import com.linsir.lin.dto.MetaObjectDTO;
import com.linsir.lin.pojo.MetaObject;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * @ProjectName:linsir-lin
 * @Package:com.linsir.lin.service
 * @Title: MetaObjectService
 * @Description: TODO
 * @Create:2021/6/5 22:24 by @author:Linsir
 * @Update:2021/6/5 22:24 by @author:Linsir
 * @UpdateRemark: 初始创建
 * @Version 1.0.0
 */
public interface MetaObjectService {

    /**
     * 增加
     * @param metaObject
     * @return
     */
    BaseResponse<MetaObject> add(MetaObject metaObject);


    /**
     *
     * @param page
     * @param limit
     * @param searchParams
     * @return
     */
    GridDTO<MetaObjectDTO> grid(String page,
                             String limit,
                             String searchParams) throws IOException, InvocationTargetException, IllegalAccessException;

    /**
     * 从pojo 到 DTO
     * @param metaObject
     * @return
     */
    MetaObjectDTO toDto(MetaObject metaObject) throws InvocationTargetException, IllegalAccessException;

    /**
     *
     * @param metaObjectList
     * @return
     */
    List<MetaObjectDTO> toDtoList(List<MetaObject> metaObjectList) throws InvocationTargetException, IllegalAccessException;

    /**
     * 根据id 获取 MetaObjectDTO 对象
     * @param id
     * @return
     */
    MetaObjectDTO getMetaObjectDTOById(Integer id) throws InvocationTargetException, IllegalAccessException;


    /**
     * 根据code 获取 MetaObjectDTO 对象
     * @param code
     * @return
     */
    MetaObjectDTO getMetaObjectDTOByCode(String code) throws InvocationTargetException, IllegalAccessException;


    /**
     *
     * @param ids
     * @return
     */
    BaseResponse<Boolean> batchDel(String ids);

}
